{{#each states}}
    <{{kind}} id="{{id}}"{{#if initial}} initial="{{initial}}"{{/if}}{{#if type}} type="{{type}}"{{/if}}>
    {{> scxml.states.template.hbs}}
    {{#each ./onentries}}
        <onentry>{{.}}</onentry>
    {{/each}}
    {{#each ./onexits}}
        <onexit>{{.}}</onexit>
    {{/each}}
    {{#each ./transitions}}
        {{#if action}}
        <transition {{#if event}}event="{{event}}" {{/if}}{{#if cond}}cond="{{cond}}" {{/if}}{{#if type}}type="{{type}}" {{/if}}target="{{target}}">
            {{action}}
        </transition>
        {{else}}
        <transition {{#if event}}event="{{event}}" {{/if}}{{#if cond}}cond="{{cond}}" {{/if}}{{#if type}}type="{{type}}" {{/if}}target="{{target}}"/>
        {{/if}}
    {{/each}}
    </{{kind}}>
{{/each}}
